import { OpManufacturerTypeIM, OpManufacturerTypePPM, OpManufacturerTypeLRM } from '@/model/operations/manufacturertype.model';
import { defHttp } from '@/utils/http/axios';

const basicApi = '/operations/admin/manufacturertype';

enum Api {
  LIST = basicApi + '/list',
  GET = basicApi + '/',
  ADD = basicApi,
  EDIT = basicApi,
  DEL_BATCH = basicApi + '/batch/',
}

/** 查询资产分类列表 */
export const listOpManufacturerTypeApi = (params?: OpManufacturerTypePPM) =>
  defHttp.get<OpManufacturerTypeLRM>({ url: Api.LIST, params });

/** 查询资产分类详细 */
export const getOpManufacturerTypeApi = (id: string) =>
  defHttp.get<OpManufacturerTypeIM>({ url: Api.GET, params: id });

/** 新增资产分类 */
export const addOpManufacturerTypeApi = (params: OpManufacturerTypeIM) =>
  defHttp.post({ url: Api.ADD, params });

/** 修改资产分类 */
export const editOpManufacturerTypeApi = (params: OpManufacturerTypeIM) =>
  defHttp.put({ url: Api.EDIT, params });

/** 删除资产分类 */
export const delOpManufacturerTypeApi = (ids: string | string[]) =>
  defHttp.delete({ url: Api.DEL_BATCH, params: ids.toString() });
